package org.example.messagewall.mapper;

import org.apache.ibatis.annotations.*;
import org.example.messagewall.model.MessageInfo;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 九转苍翎
 * Date: 2025/7/25
 * Time: 17:14
 */
@Mapper
public interface MessageInfoMapper {
    //发布留言
    @Insert("insert into message_info (`from`,`to`,`message`) values (#{from},#{to},#{say})")
    Integer insertMessage(MessageInfo messageInfo);
    //获取留言列表
    @Results(id = "message_info",value={
            @Result(property = "say",column = "message")
    })
    @Select("select * from message_info")
    List<MessageInfo> getMessageInfoAll();
}
